#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstring>
#define ll long long
using namespace std;
struct node{
	int num,mum;
	int x;
}a[8080];
bool cmp(node j,node k)
{
	if(j.x==k.x) return j.num<=k.num;
	else return j.x<=k.x;
}
int n,Q;
int main()
{
	freopen("sort.in","r",stdin);
	freopen("sort.out","w",stdout); 
	scanf("%d%d",&n,&Q);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i].x);
		a[i].num=i;
	}
	sort(a+1,a+n+1,cmp);
	for(int i=1;i<=n;i++)
		a[i].mum=i;	
	int y,y1,y2;
	while(Q--)
	{
		scanf("%d",&y);
		if(y==1) 
		{
			scanf("%d%d",&y1,&y2);
			a[y1].x=y2;
		}
		else{
			scanf("%d",&y1);
			sort(a+1,a+n+1,cmp);
			for(int i=1;i<=n;i++)
				if(a[i].num==y1)
					printf("%d\n",a[i].mum);
		}
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
 } 
